package com.cairenhui.trust.auto.task.executor;

import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cairenhui.trust.auto.task.service.impl.BaseSysUserTaskService;
import com.cairenhui.trust.auto.task.util.DateUtils;

/**
 * 
 * @author 黄瑞庆
 * TODO 员工信息更新
 * 2017年2月27日
 */
@Component
public class BaseSysUserFetchExecutor extends EasyAutotaskExecutor{
	
	//self4j日志
	private Logger logger = LoggerFactory.getLogger(BaseSysUserFetchExecutor.class);
	
	@Autowired
	private BaseSysUserTaskService baseSysUserTaskService;
	
	@Override
	public String getCron() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean inuse() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void execute() {
		
		logger.info(
				this.getClass().getSimpleName() + "更新员工信息开始>>>>>>开始时间{}",
				DateUtils.getStrDate(new Date(), DateUtils.STRDATE_1
						+ DateUtils.HOURS_MINUTES_SECONDS));
		Date start = new Date();

		baseSysUserTaskService.sysCrm();

		Date end = new Date();

		logger.info(
				this.getClass().getSimpleName()
						+ "更新员工信息结束>>>>>>结束时间{},耗时{}秒",
				DateUtils.getStrDate(new Date(), DateUtils.STRDATE_1
						+ DateUtils.HOURS_MINUTES_SECONDS),
				DateUtils.getTimeDifference(start, end));
		
	}

}
